Integrand size = 21, antiderivative size = 62 \[ \int \tan (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=-\frac {(a-b)^2 \log (\cos (e+f x))}{f}+\frac {(a-b) b \tan ^2(e+f x)}{2 f}+\frac {\left (a+b \tan ^2(e+f x)\right )^2}{4 f} \]
Time = 0.25 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.87 \[ \int \tan (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {-4 (a-b)^2 \log (\cos (e+f x))+2 (2 a-b) b \tan ^2(e+f x)+b^2 \tan ^4(e+f x)}{4 f} \]
Time = 0.25 (sec) , antiderivative size = 60, normalized size of antiderivative = 0.97, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3042, 4153, 353, 49, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \tan (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \tan (e+f x) \left (a+b \tan (e+f x)^2\right )^2dx\) |
\(\Big \downarrow \) 4153 |
\(\displaystyle \frac {\int \frac {\tan (e+f x) \left (b \tan ^2(e+f x)+a\right )^2}{\tan ^2(e+f x)+1}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 353 |
\(\displaystyle \frac {\int \frac {\left (b \tan ^2(e+f x)+a\right )^2}{\tan ^2(e+f x)+1}d\tan ^2(e+f x)}{2 f}\) |
\(\Big \downarrow \) 49 |
\(\displaystyle \frac {\int \left (\frac {(a-b)^2}{\tan ^2(e+f x)+1}+b (a-b)+b \left (b \tan ^2(e+f x)+a\right )\right )d\tan ^2(e+f x)}{2 f}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {b (a-b) \tan ^2(e+f x)+\frac {1}{2} \left (a+b \tan ^2(e+f x)\right )^2+(a-b)^2 \log \left (\tan ^2(e+f x)+1\right )}{2 f}\) |
((a - b)^2*Log[1 + Tan[e + f*x]^2] + (a - b)*b*Tan[e + f*x]^2 + (a + b*Tan [e + f*x]^2)^2/2)/(2*f)
3.2.100.3.1 Defintions of rubi rules used
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int [ExpandIntegrand[(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && IGtQ[m, 0] && IGtQ[m + n + 2, 0]
Int[(x_)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_.), x_Symbol] :> Simp[1/2 Subst[Int[(a + b*x)^p*(c + d*x)^q, x], x, x^2], x] /; FreeQ[ {a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0]
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[c*(ff/f) Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio nalQ[n]))
Time = 0.05 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.06
method | result | size |
norman | \(\frac {b^{2} \tan \left (f x +e \right )^{4}}{4 f}+\frac {b \left (2 a -b \right ) \tan \left (f x +e \right )^{2}}{2 f}+\frac {\left (a^{2}-2 a b +b^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f}\) | \(66\) |
derivativedivides | \(\frac {\frac {b^{2} \tan \left (f x +e \right )^{4}}{4}+\tan \left (f x +e \right )^{2} a b -\frac {b^{2} \tan \left (f x +e \right )^{2}}{2}+\frac {\left (a^{2}-2 a b +b^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}}{f}\) | \(67\) |
default | \(\frac {\frac {b^{2} \tan \left (f x +e \right )^{4}}{4}+\tan \left (f x +e \right )^{2} a b -\frac {b^{2} \tan \left (f x +e \right )^{2}}{2}+\frac {\left (a^{2}-2 a b +b^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}}{f}\) | \(67\) |
parallelrisch | \(\frac {b^{2} \tan \left (f x +e \right )^{4}+4 \tan \left (f x +e \right )^{2} a b -2 b^{2} \tan \left (f x +e \right )^{2}+2 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a^{2}-4 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a b +2 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) b^{2}}{4 f}\) | \(91\) |
parts | \(\frac {a^{2} \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f}+\frac {b^{2} \left (\frac {\tan \left (f x +e \right )^{4}}{4}-\frac {\tan \left (f x +e \right )^{2}}{2}+\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}\right )}{f}+\frac {a b \tan \left (f x +e \right )^{2}}{f}-\frac {a b \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{f}\) | \(94\) |
risch | \(i a^{2} x -2 i a b x +i b^{2} x +\frac {2 i a^{2} e}{f}-\frac {4 i a b e}{f}+\frac {2 i b^{2} e}{f}+\frac {4 b \left (a \,{\mathrm e}^{6 i \left (f x +e \right )}-b \,{\mathrm e}^{6 i \left (f x +e \right )}+2 a \,{\mathrm e}^{4 i \left (f x +e \right )}-b \,{\mathrm e}^{4 i \left (f x +e \right )}+a \,{\mathrm e}^{2 i \left (f x +e \right )}-b \,{\mathrm e}^{2 i \left (f x +e \right )}\right )}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{4}}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) a^{2}}{f}+\frac {2 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) a b}{f}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) b^{2}}{f}\) | \(200\) |
1/4*b^2/f*tan(f*x+e)^4+1/2*b*(2*a-b)/f*tan(f*x+e)^2+1/2*(a^2-2*a*b+b^2)/f* ln(1+tan(f*x+e)^2)
Time = 0.27 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.03 \[ \int \tan (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {b^{2} \tan \left (f x + e\right )^{4} + 2 \, {\left (2 \, a b - b^{2}\right )} \tan \left (f x + e\right )^{2} - 2 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right )}{4 \, f} \]
1/4*(b^2*tan(f*x + e)^4 + 2*(2*a*b - b^2)*tan(f*x + e)^2 - 2*(a^2 - 2*a*b + b^2)*log(1/(tan(f*x + e)^2 + 1)))/f
Leaf count of result is larger than twice the leaf count of optimal. 112 vs. \(2 (49) = 98\).
Time = 0.13 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.81 \[ \int \tan (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\begin {cases} \frac {a^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - \frac {a b \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{f} + \frac {a b \tan ^{2}{\left (e + f x \right )}}{f} + \frac {b^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {b^{2} \tan ^{4}{\left (e + f x \right )}}{4 f} - \frac {b^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} & \text {for}\: f \neq 0 \\x \left (a + b \tan ^{2}{\left (e \right )}\right )^{2} \tan {\left (e \right )} & \text {otherwise} \end {cases} \]
Piecewise((a**2*log(tan(e + f*x)**2 + 1)/(2*f) - a*b*log(tan(e + f*x)**2 + 1)/f + a*b*tan(e + f*x)**2/f + b**2*log(tan(e + f*x)**2 + 1)/(2*f) + b**2 *tan(e + f*x)**4/(4*f) - b**2*tan(e + f*x)**2/(2*f), Ne(f, 0)), (x*(a + b* tan(e)**2)**2*tan(e), True))
Time = 0.23 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.32 \[ \int \tan (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=-\frac {2 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\sin \left (f x + e\right )^{2} - 1\right ) + \frac {4 \, {\left (a b - b^{2}\right )} \sin \left (f x + e\right )^{2} - 4 \, a b + 3 \, b^{2}}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1}}{4 \, f} \]
-1/4*(2*(a^2 - 2*a*b + b^2)*log(sin(f*x + e)^2 - 1) + (4*(a*b - b^2)*sin(f *x + e)^2 - 4*a*b + 3*b^2)/(sin(f*x + e)^4 - 2*sin(f*x + e)^2 + 1))/f
Leaf count of result is larger than twice the leaf count of optimal. 1250 vs. \(2 (58) = 116\).
Time = 1.62 (sec) , antiderivative size = 1250, normalized size of antiderivative = 20.16 \[ \int \tan (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\text {Too large to display} \]
-1/4*(2*a^2*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^ 2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 - 4*a*b*log(4 *(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan( f*x)^2 + tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 + 2*b^2*log(4*(tan(f*x)^2*tan( e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 - 4*a*b*tan(f*x)^4*tan(e)^4 + 3*b^2*tan(f*x)^4* tan(e)^4 - 8*a^2*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan( f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^3*tan(e)^3 + 16*a*b *log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^3*tan(e)^3 - 8*b^2*log(4*(tan(f*x)^ 2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + ta n(e)^2 + 1))*tan(f*x)^3*tan(e)^3 - 4*a*b*tan(f*x)^4*tan(e)^2 + 2*b^2*tan(f *x)^4*tan(e)^2 + 8*a*b*tan(f*x)^3*tan(e)^3 - 8*b^2*tan(f*x)^3*tan(e)^3 - 4 *a*b*tan(f*x)^2*tan(e)^4 + 2*b^2*tan(f*x)^2*tan(e)^4 + 12*a^2*log(4*(tan(f *x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^2*tan(e)^2 - 24*a*b*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1)) *tan(f*x)^2*tan(e)^2 + 12*b^2*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan( e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^2*tan( e)^2 - b^2*tan(f*x)^4 + 8*a*b*tan(f*x)^3*tan(e) - 8*b^2*tan(f*x)^3*tan(...
Time = 11.26 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.10 \[ \int \tan (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (\frac {a^2}{2}-a\,b+\frac {b^2}{2}\right )}{f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (a\,b-\frac {b^2}{2}\right )}{f}+\frac {b^2\,{\mathrm {tan}\left (e+f\,x\right )}^4}{4\,f} \]